package com.signcomplex.nettyandroid;

/**
 * Created by Administrator on 2016/7/13 0013.
 */
public class ByteUtil {

    public static byte[] assembly(byte[] buf, int head) {
        int len = buf.length;
        byte[] data = new byte[len + 1];
        data[0] = (byte) head;
        for (int i = 0; i < len; i++)
            data[i + 1] = buf[i];
        return data;
    }

    public static byte[] assembly(byte[] buf) {
        int len = buf.length;
        byte[] data = new byte[len - 1];
        for (int i = 0; i < len - 1; i++)
            data[i] = buf[i + 1];
        return data;
    }
}
